package com.miaoquan.mqapitbk.exception;


import com.miaoquan.mqcommon.api.CommonResult;
import com.miaoquan.mqcommon.api.ResultCode;
import com.taobao.api.ApiException;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 异常处理
 * Created by macro on 2020/2/27.
 */
@ControllerAdvice
@ResponseBody
public class ApiExceptionHandler {

    @ExceptionHandler(value = ApiException.class)
    public CommonResult<Object> exceptionHandler(ApiException e) {
        return CommonResult.failed(ResultCode.TBK_API);
    }

}
